<%-- 
    Document   : product
    Created on : 19-déc.-2012, 7:41:26
    Author     : Anthares
--%>
<%@page session="false" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib tagdir="/WEB-INF/tags" prefix="jt" %>
<%@taglib prefix="core" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<core:set var="pagename" scope="request" value="basket"/>
<fmt:setLocale value="${requestScope.locale}"/>
<fmt:setBundle basename="Languages.lang"/>
<core:set var="pagename" scope="request" value="shop"/>
<core:if test="${product==null}"><core:redirect url="/shop"/></core:if>
<jt:layout pageTitle="Shop">
    <jsp:body>
        <div id="prod-wrapper">
            <div id="img-wrapper"><img src="<core:url value="${product.image}"/>"></div>
            <p id="prod-name">${product.traduction.libelle}</p>
            <div id="prod-commands">
                <core:if test="${product.onPromotion}">
                    <p><del><fmt:formatNumber value="${product.prixUnit}" type="currency"/></del></p>
                    <p><fmt:message key="promo.availaible.until"/> : <fmt:formatDate value="${product.bestPromotions.dateFin}"/></p>
                </core:if>
                <br/>
                <p id="prod-price"><fmt:formatNumber value="${product.reducedPrice}" type="currency"/></p>
                <br/>
                <form id="prod-order" method="POST" action="<core:url value="/basket/add"/>">
                    <label>Quantity :<input class="top" type="text" name="quantity" value="1" data-validation-engine="validate[required,custom[integer],min[1]]"></label>
                    <input type="hidden" name="prodId" value="${product.prodId}">
                    <input class="button bottom" type="submit">
                </form>
            </div>
            <div id="prod-desc">${product.traduction.descrip}</div>
        </div>
        <script>
            $('#prod-order').validationEngine('attach');
        </script>
    </jsp:body>
</jt:layout>
